<%-- 
    Document   : registroAdmPersona
    Created on : 07/12/2012, 07:42:55 PM
    Author     : VANIE
--%>

<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<script type="text/javascript" src="<%=request.getContextPath()%>/js/generic.js"></script>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/default.css"/>
<f:view>


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title> Strategy <h:outputText value="Registro de Persona"/></title>
</head>
<body>
<script type="text/javascript">
var formRegPersona = 'formRegPersona:';
</script>
<table align="center" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="450" valign="top">
<h:form id="formRegPersona">
<a4j:jsFunction name="establecerPersona" actionListener="#{registroAdmPersona.establecerPersona}" oncomplete="establishFocus('formRegPersona','txtsugNombre')" reRender="panPrincipal"/>
<h:panelGrid id="panPrincipal">
    <h:panelGrid columns="4">
        <h:outputText value="Buscar Persona" styleClass="lblcampotitulo8"/>
        <h:outputText value="" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:panelGrid columns="4" id ="panBusqueda" cellpadding="0" cellspacing="0">
            <h:inputText id="txtsugNombre" size="50" value="#{registroAdmPersona.nombreBuscar}" styleClass="txtcontrol8" onfocus="suggestionValueClean('formRegPersona', 'txtsugNombre')"/>
            <rich:suggestionbox for="txtsugNombre" suggestionAction="#{registroAdmPersona.consultarPersonas}" var="persona" width="410" height="120" minChars="3" ajaxSingle="false"
                                border="1" shadowDepth="2" fetchValue="#{persona.codPersona}" ignoreDupResponses="true">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="CÓDIGO" styleClass="lblcampotitulo8"/>
                    </f:facet>
                    <h:outputText value="#{persona.codPersona}" styleClass="sugseleccionitem100"/>
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="NOMBRE PERSONA" styleClass="lblcampotitulo8"/>
                    </f:facet>
                    <h:outputText value="#{persona.nombreCompleto}" styleClass="sugseleccionitem300"/>
                </h:column>
                <a4j:support event="onselect" ajaxSingle="true" oncomplete="establecerPersona(); ">
                    <f:setPropertyActionListener value="#{persona.codPersona}" target="#{registroAdmPersona.codPersona}" />
                </a4j:support>
            </rich:suggestionbox>
            <f:verbatim> &nbsp;</f:verbatim>
            <a4j:commandButton value="* Nuevo" action="#{registroAdmPersona.limpiarDatos}" reRender="formRegPersona" styleClass="btncontrol80"/>
        </h:panelGrid>

        <h:outputText value="Apellido Paterno" styleClass="lblcampotitulo8"/>
        <h:outputText value="*" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputText value="#{registroAdmPersona.apePaterno}" size="22" maxlength="20" styleClass="txtcontrol8"/>

        <h:outputText value="Apellido Materno" styleClass="lblcampotitulo8"/>
        <h:outputText value="*" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputText value="#{registroAdmPersona.apeMaterno}" size="22" maxlength="20" styleClass="txtcontrol8"/>

        <h:outputText value="Nombres" styleClass="lblcampotitulo8"/>
        <h:outputText value="*" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:panelGrid columns="3" cellpadding="0" cellspacing="0">
            <h:inputText value="#{registroAdmPersona.nombre1}" size="22" maxlength="20" styleClass="txtcontrol8"/>
            <f:verbatim> &nbsp;</f:verbatim>
            <h:inputText value="#{registroAdmPersona.nombre2}" size="22" maxlength="20" styleClass="txtcontrol8"/>
        </h:panelGrid>

        <h:outputText value="Fecha Nacimiento" styleClass="lblcampotitulo8"/>
        <h:outputText value="*" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:panelGrid columns="3" cellpadding="0" cellspacing="0">
            <rich:calendar id="fecInicio" datePattern="yyyy-MM-dd" value="#{registroAdmPersona.fecNacimiento}"
                           oninputchange="validarFecha()" onchanged="validarFecha()" inputSize="10"
                           inputClass="txtcontrol8" enableManualInput="true"/>
            <f:verbatim> &nbsp;</f:verbatim>
            <h:outputText value="AAAA-MM-DD" styleClass="lbltextoitem7"/>
        </h:panelGrid>

        <h:outputText value="Sexo" styleClass="lblcampotitulo8"/>
        <h:outputText value="*" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:selectOneMenu id="selSexo" value="#{registroAdmPersona.sexo}" styleClass="cmbseleccion278">
            <f:selectItem itemLabel="-- SELECCIONAR --" itemValue="-1"/>
            <f:selectItem itemLabel="MASCULINO" itemValue="M"/>
            <f:selectItem itemLabel="FEMENINO" itemValue="F"/>
        </h:selectOneMenu>

        <h:outputText value="Dirección" styleClass="lblcampotitulo8"/>
        <h:outputText value="*" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputTextarea cols="48" rows="3" value="#{registroAdmPersona.direccion}" styleClass="txtcontrol8"/>

        <h:outputText value="Distrito" styleClass="lblcampotitulo8"/>
        <h:outputText value="" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputText value="#{registroAdmPersona.distrito}" size="22" maxlength="50" styleClass="txtcontrol8"/>

        <h:outputText value="Telefono" styleClass="lblcampotitulo8"/>
        <h:outputText value="" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputText value="#{registroAdmPersona.telefono}" size="22" maxlength="20" styleClass="txtcontrol8"/>

        <h:outputText value="Celular" styleClass="lblcampotitulo8"/>
        <h:outputText value="" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputText value="#{registroAdmPersona.celular1}" size="22" maxlength="20" styleClass="txtcontrol8"/>

        <h:outputText value="Celular" styleClass="lblcampotitulo8"/>
        <h:outputText value="" styleClass="lblcamporequerido10"/>
        <h:outputText value=":" styleClass="lblcampotitulo8"/>
        <h:inputText value="#{registroAdmPersona.celular2}" size="22" maxlength="20" styleClass="txtcontrol8"/>

        <h:panelGrid width="120"></h:panelGrid>
        <h:panelGrid width="20"></h:panelGrid>
        <h:panelGrid width="10"></h:panelGrid>
    </h:panelGrid>
</h:panelGrid>

<h:panelGrid width="100%">
    <hr color="#000033" style="color:#006"/>
</h:panelGrid>

<h:panelGrid columns="4" width="100%" style="text-align:center;">
    <h:panelGrid width="100"></h:panelGrid>
    <a4j:commandButton value="Guardar" actionListener="#{registroAdmPersona.guardar}" reRender="panPrincipal" styleClass="btncontrol120"/>
    <h:commandButton value="Salir" action="#{registroAdmPersona.salir}" styleClass="btncontrol120"/>
    <h:panelGrid width="100"></h:panelGrid>
</h:panelGrid>
</h:form>
</td>
</tr>
</table>
</body>
</html>
</f:view>